
<div class="nav_col">

    <div class="preview">
    <div class="contain">
        <? $this->load->view('admin/previews/category_item_list', array("item" => $item))?>
    </div>             
    </div>             

    <div class="buttons">                                                                                 

    <? if ($action == "view") { ?>

        <a href="<?=site_url('admin/'.$controller.'/edit/'.$item['id_Categories'])?>" class="button">edit</a>
        
        <? if ($item['Active_Categories']!=1){ ?>            
        <a href="<?=site_url('admin/'.$controller.'/activate/'.$item['id_Categories'])?>" class="button">activate</a>
        <? } else { ?> 
        <a href="<?=site_url('admin/'.$controller.'/deactivate/'.$item['id_Categories'])?>" class="button">deactivate</a>
        <? } ?>
        
        <a href="<?=site_url('admin/'.$controller.'/remove/'.$item['id_Categories'])?>" class="button">delete</a>

        <? if ($item['Active_Categories']!=1){ ?>
            <div class="preview_inactive">This item is inactive</div>
        <? } ?>

    <? } ?>

    </div>

</div>               


<div class="item_col preview">   

    <? $this->load->view('admin/previews/category_item_detail', array("item" => $item))?>



    <? //show products or subcategories

        if (!empty($subitems)) { 

        $i=1;
        foreach($subitems as $subitem){ 
        ?>

            <? if (is_int(($i+2)/3)){ ?>
                <div class="summarycontainer">
            <? } ?> 
            
                <div class="contain<? if (is_int($i/3)) echo 'right'?>">
                <? $this->load->view('admin/previews/product_item_list', array("item" => $subitem))?>
                </div>                 

            <? if ( (is_int($i/3)) || ($i==count($subitems)) ){ ?>
                </div>
            <? } ?> 
        <? 
            $i++;
        } 
    } 
    ?>

</div>